﻿@inject IHttpService _httpService
@inject IPopupService PopupService
@inject NavigationManager NavigationManager

<MDCard>
    <DataTableCard TModel="PerfectionCheckOverviewModel" Headers="_headers" ApiUrl="@(_baseUrl)" ShowAddButton="false" Title="@($"{_name}列表")" @ref="dataTableCard">
        <ItemColContent>
            @if (context.Header.Value == nameof(PerfectionCheckOverviewModel.Name))
            {
                <CnGalWebSite.Shared.MasaComponent.PC.Admin.Users.Certifications.EntryChip Id="@context.Item.Id" Name="@context.Item.Name" Type="@EntryType.Game" />
            }
            else
            {
                @context.Value
            }
        </ItemColContent>
    </DataTableCard>
</MDCard>




@code {
    private bool _editDialog;
    private long _editedItemId;
    private bool _detailDialog;

    private string _baseUrl = "api/perfections/ListPerfectionChecks";
    private string _name = "完善度单项检查";

    private List<DataTableHeader<PerfectionCheckOverviewModel>> _headers = new List<DataTableHeader<PerfectionCheckOverviewModel>>
    {
        new ()
          {
            Text= "Id",
            Align= DataTableHeaderAlign.Start,
            Value= nameof(PerfectionCheckOverviewModel.Id),
            Sortable=false
          },
          new (){ Text= "词条", Value= nameof(PerfectionCheckOverviewModel.Name), Sortable=false},
          new (){ Text= "检查", Value= nameof(PerfectionCheckOverviewModel.Type), Sortable=false},
          new (){ Text= "分数", Value= nameof(PerfectionCheckOverviewModel.Grade)},
          new (){ Text= "击败全站词条百分比", Value= nameof(PerfectionCheckOverviewModel.VictoryPercentage)},
    };

    DataTableCard<PerfectionCheckOverviewModel> dataTableCard;
}
